import { Component, OnInit } from '@angular/core';

declare var form: any;

@Component({
  templateUrl: './org.department.html'
})
export class OrgDepartmentComponent implements OnInit {
  fs: any = null;
  orgDic: any = null;
  typeDic: any = null;

  constructor() {
    // 注册表单
    this.fs = new form.FormTreeService('department', {
      keyField: 'id',
      randomFields: ['id'],
      orderObject: { order: 0 },
      pageSize: 1000,
      defaultObject: { leaf: false }
    });
    this.fs.loadData(true);

    // 初始化字典
    this.orgDic = new form.DictionaryService('p_organization');
    this.orgDic.load('0');
    this.typeDic = new form.DictionaryService('p_dep_type');
  }

  ngOnInit(): void {
  }
}
